<template>
  <div>
    <el-form :model="detailForm" :rules="rules" ref="ruleForm">
      <h5 class="titleText">基本信息</h5>
      <!-- 第一行 -->
      <el-row type="flex">
        <el-col :span="6" justify="space-between">
          <el-form-item
            label="所属调管调度机构:"
            :label-width="formLabelWidth"
            size="mini"
            prop="regulationOrgId"
          >
            <el-select
              v-model="detailForm.regulationOrgId"
              placeholder="请选择"
              :disabled="operate === 'edit'"
              @change="stationNameChange"
            >
              <el-option
                v-for="item in dispatchList.filter(
                  (item) => item.label !== '全部'
                )"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item
            label="类型:"
            :label-width="formLabelWidth"
            size="mini"
            prop="stationType"
          >
            <el-select
              v-model="detailForm.stationType"
              placeholder="请选择"
              :disabled="operate === 'edit'"
              @change="stationNameChange"
            >
              <el-option
                v-for="item in stationTypeLists.filter(
                  (item) => item.label !== '全部'
                )"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item
            label="产权单位:"
            :label-width="formLabelWidth"
            size="mini"
            :rules="[{ required: true }]"
          >
            <SelectAdd
              :labelslist="companyLists"
              label="unitName"
              ref="company"
              val="unitId"
              :api="getCompanyList"
              query="unitId"
              order="产权单位"
              :formVla="detailForm.companyId"
              @getQueryStationList="queryCompanyList"
              :disabledSelect="disabledSelect"
              :delApi="deleteCompanyInfo"
              @changeEvent="stationNameChange1"
            ></SelectAdd>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item
            label="场站名称:"
            :label-width="formLabelWidth"
            size="mini"
            :rules="[{ required: true }]"
            :error="stationIdError"
          >
            <SelectAdd
              :labelslist="stationLists"
              label="stationName"
              val="stationId"
              :api="getInsertStationInfo"
              query="stationId"
              :formVla="detailForm.stationId"
              ref="station"
              :regulationOrgId="detailForm.regulationOrgId"
              :companyId="detailForm.companyId"
              regulation="regulationOrgId"
              stationCategory="1"
              :stationTypes="detailForm.stationType"
              @getQueryStationList="getQueryStationList"
              :order="order"
              :disabledSelect="disabledSelect"
              :delApi="deleteCompanyInfo"
              :delFlag="false"
            ></SelectAdd>
          </el-form-item>
        </el-col>
        <!-- <el-col :span="6">
          <el-form-item label="机组编号:" :label-width="formLabelWidth" size="mini" prop="unitsNumber">
            <el-input
              v-model.trim="detailForm.unitsNumber"
              autocomplete="off"
              size="mini"
              maxlength="40"
              placeholder="输入机组编号"
              clearable
            ></el-input>
          </el-form-item>
        </el-col> -->
      </el-row>
      <!-- 第二行 -->
      <el-row type="flex" justify="space-between">
        <el-col :span="6">
          <el-form-item
            label="机组编号:"
            :label-width="formLabelWidth"
            size="mini"
            prop="unitsNumber"
          >
            <el-input
              v-model.trim="detailForm.unitsNumber"
              autocomplete="off"
              size="mini"
              maxlength="40"
              placeholder="输入机组编号"
              clearable
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item
            label="单机容量:"
            :label-width="formLabelWidth"
            size="mini"
            prop="singleMachineCap"
          >
            <el-input
              v-model.trim="detailForm.singleMachineCap"
              autocomplete="off"
              type="number"
              clearable
              size="mini"
              oninput="value= value.length>40?value.slice(0,40):value"
              placeholder="输入单机容量"
              style="width: calc(100% - 30px)"
              @input="singleMachineCapChange(detailForm.singleMachineCap)"
            ></el-input>
            <span class="unitClass">MW</span>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item
            label="台数:"
            :label-width="formLabelWidth"
            size="mini"
            prop="machineNum"
          >
            <el-input
              v-model.trim="detailForm.machineNum"
              autocomplete="off"
              type="number"
              size="mini"
              oninput="value= value.length>40?value.slice(0,40):value"
              placeholder="输入机组台数"
              clearable
              @input="stationCapChange(detailForm.machineNum)"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item
            label="总容量:"
            :label-width="formLabelWidth"
            size="mini"
          >
            <el-input
              v-model.trim="detailForm.unitsTotalCap"
              autocomplete="off"
              size="mini"
              maxlength="40"
              placeholder="输入机组总容量"
              style="width: calc(100% - 30px)"
              clearable
              disabled
            ></el-input>
            <span class="unitClass">MW</span>
          </el-form-item>
        </el-col>
        <!-- <el-col :span="6">
          <el-form-item label="发电集团：" :label-width="formLabelWidth" size="mini" :rules="[{ required: true }]">
            <SelectAdd
              :labelslist="companyLists"
              label="unitName"
              ref="company"
              val="unitId"
              :api="getCompanyList"
              query="unitId"
              order="发电集团"
              :formVla="detailForm.companyId"
              @getQueryStationList="queryCompanyList"
              :disabledSelect="disabledSelect"
              :delApi="deleteCompanyInfo"
            ></SelectAdd>
          </el-form-item>
        </el-col> -->
      </el-row>
      <h5 class="titleText">文件上传</h5>
      <el-row>
        <el-col :span="9">
          <el-form-item
            label="一次调频实验方案:"
            :label-width="formLabelWidth"
            size="mini"
          >
            <el-upload
              ref="upload"
              action="#"
              class="upload-demo"
              :on-change="onChange2"
              :multiple="false"
              :limit="2"
              :on-exceed="handleExceed"
              :file-list="fileList2"
              :http-request="uploadHttpReq"
              :auto-upload="false"
              :show-file-list="false"
            >
              <div>
                <el-button size="mini">选择文件</el-button>
              </div>
            </el-upload>
            <el-tooltip
              class="item"
              effect="dark"
              :content="detailForm.regulationTestPlan"
              placement="top"
              :disabled="detailForm.regulationTestPlan ? false : true"
            >
              <el-input
                v-model.trim="detailForm.regulationTestPlan"
                clearable
                style="width: 77%"
                placeholder="仅支持pdf、excel格式的文件"
                disabled
              ></el-input>
            </el-tooltip>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="上传时间:" size="mini">
            <el-date-picker
              v-model="detailForm.regulationTime2"
              type="datetime"
              placeholder="选择日期"
              :value-format="'yyyy-MM-dd HH:mm:ss'"
              disabled
              style="width: 75%"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="审核通过:" size="mini">
            <el-select
              v-model="detailForm.caseIsAudited"
              size="mini"
              placeholder="请选择"
              style="width: 75%"
            >
              <el-option
                v-for="item in isYes"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="审核时间:" size="mini">
            <el-date-picker
              v-model="detailForm.regulationTime2"
              type="datetime"
              placeholder="选择日期"
              :value-format="'yyyy-MM-dd HH:mm:ss'"
              disabled
              style="width: 75%"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="9">
          <el-form-item
            label="一次调频测试报告:"
            :label-width="formLabelWidth"
            size="mini"
          >
            <el-upload
              ref="upload"
              action="#"
              class="upload-demo"
              :on-change="onChange3"
              :multiple="false"
              :limit="2"
              :on-exceed="handleExceed"
              :file-list="fileList3"
              :http-request="uploadHttpReq"
              :auto-upload="false"
              :show-file-list="false"
            >
              <div>
                <el-button size="mini">选择文件</el-button>
              </div>
            </el-upload>
            <el-tooltip
              class="item"
              effect="dark"
              :content="detailForm.regulationTestReport"
              placement="top"
              :disabled="detailForm.regulationTestReport ? false : true"
            >
              <el-input
                v-model.trim="detailForm.regulationTestReport"
                style="width: 77%"
                placeholder="仅支持pdf、excel格式的文件"
                clearable
                disabled
              ></el-input>
            </el-tooltip>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="上传时间:" size="mini">
            <el-date-picker
              v-model="detailForm.regulationTime3"
              type="datetime"
              placeholder="选择日期"
              :value-format="'yyyy-MM-dd HH:mm:ss'"
              disabled
              style="width: 75%"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="审核通过:" size="mini">
            <el-select
              v-model="detailForm.caseIsAudited"
              size="mini"
              placeholder="请选择"
              style="width: 75%"
            >
              <el-option
                v-for="item in isYes"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="审核时间:" size="mini">
            <el-date-picker
              v-model="detailForm.regulationTime2"
              type="datetime"
              placeholder="选择日期"
              :value-format="'yyyy-MM-dd HH:mm:ss'"
              disabled
              style="width: 75%"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <h5 class="titleText">主动测试</h5>
      <el-row type="flex" justify="space-between">
        <el-col :span="8">
          <el-form-item
            label="主动测试次数:"
            :label-width="formLabelWidth"
            size="mini"
            prop="activeTestNum"
          >
            <el-input
              v-model.trim="detailForm.activeTestNum"
              autocomplete="off"
              size="mini"
              maxlength="40"
              placeholder="输入主动测试次数"
              clearable
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item
            label="合格次数:"
            :label-width="formLabelWidth"
            size="mini"
            prop="qualifiedNum"
          >
            <el-input
              v-model.trim="detailForm.qualifiedNum"
              autocomplete="off"
              type="number"
              clearable
              size="mini"
              oninput="value= value.length>40?value.slice(0,40):value"
              placeholder="输入合格次数"
              style="width: calc(100% - 30px)"
            ></el-input>
            <!-- <span class="unitClass">MW</span> -->
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item
            label="合格率:"
            :label-width="formLabelWidth"
            size="mini"
            prop="qualifiedRatio"
          >
            <el-input
              v-model.trim="detailForm.qualifiedRatio"
              autocomplete="off"
              type="number"
              size="mini"
              oninput="value= value.length>40?value.slice(0,40):value"
              placeholder="输入合格率"
              clearable
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <!-- <el-row>
        <el-col :span="14">
          <el-form-item label="一次调频定值单:" :label-width="formLabelWidth" size="mini">
            <el-upload
              ref="upload1"
              action="#"
              class="upload-demo"
              :on-change="onChange1"
              :before-upload="beforeAvatarUpload"
              :multiple="false"
              :limit="2"
              :on-exceed="handleExceed"
              :file-list="fileList1"
              :http-request="uploadHttpReq"
              :auto-upload="false"
              :show-file-list="false"
              :disabled="flagUpload"
            >
              <div>
                <el-button @click="regulationReportFormChange" size="mini">选择文件</el-button>
              </div>
            </el-upload>
            <el-tooltip
              class="item"
              effect="dark"
              :content="detailForm.regulationReportForm"
              placement="top"
              :disabled="detailForm.regulationReportForm ? false : true"
            >
              <el-input
                v-model.trim="detailForm.regulationReportForm"
                style="width: 60%"
                placeholder="仅支持pdf、excel格式的文件"
                disabled
                clearable
              ></el-input>
            </el-tooltip>
            <p style="font-size: 12px !important; color: red" v-if="detailForm.isDelay === '1'">(已滞后两周,请尽快上传)</p>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="上传时间:" size="mini">
            <el-date-picker
              v-model="detailForm.regulationTime1"
              type="datetime"
              placeholder="选择日期"
              :value-format="'yyyy-MM-dd HH:mm:ss'"
              disabled
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row> -->
      <!-- <el-row>
        <el-col :span="10">
          <el-form-item
            label="惯量响应方案:"
            :label-width="formLabelWidth"
            size="mini"
          >
            <el-upload
              ref="upload"
              action="#"
              class="upload-demo"
              :on-change="onChange4"
              :multiple="false"
              :limit="2"
              :on-exceed="handleExceed"
              :file-list="fileList4"
              :http-request="uploadHttpReq"
              :auto-upload="false"
              :show-file-list="false"
            >
              <div>
                <el-button size="mini">选择文件</el-button>
              </div>
            </el-upload>
            <el-tooltip
              class="item"
              effect="dark"
              :content="detailForm.responsePlan"
              placement="top"
              :disabled="detailForm.responsePlan ? false : true"
            >
              <el-input
                v-model.trim="detailForm.responsePlan"
                style="width: 65%"
                placeholder="仅支持pdf、excel格式的文件"
                disabled
                clearable
              ></el-input>
            </el-tooltip>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="上传时间:" size="mini">
            <el-date-picker
              v-model="detailForm.regulationTime4"
              type="datetime"
              placeholder="选择日期"
              :value-format="'yyyy-MM-dd HH:mm:ss'"
              disabled
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="10">
          <el-form-item
            label="惯量响应报告:"
            :label-width="formLabelWidth"
            size="mini"
          >
            <el-upload
              ref="upload"
              action="#"
              class="upload-demo"
              :on-change="onChange5"
              :multiple="false"
              :limit="2"
              :on-exceed="handleExceed"
              :file-list="fileList5"
              :http-request="uploadHttpReq"
              :auto-upload="false"
              :show-file-list="false"
            >
              <div>
                <el-button size="mini">选择文件</el-button>
              </div>
            </el-upload>
            <el-tooltip
              class="item"
              effect="dark"
              :content="detailForm.responseReport"
              placement="top"
              :disabled="detailForm.responseReport ? false : true"
            >
              <el-input
                v-model.trim="detailForm.responseReport"
                style="width: 65%"
                placeholder="仅支持pdf、excel格式的文件"
                disabled
                clearable
              ></el-input>
            </el-tooltip>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="上传时间:" size="mini">
            <el-date-picker
              v-model="detailForm.regulationTime5"
              type="datetime"
              placeholder="选择日期"
              :value-format="'yyyy-MM-dd HH:mm:ss'"
              disabled
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row> -->
    </el-form>
  </div>
</template>

<script>
import TestResultEdit from './testResultEdit.js'
export default TestResultEdit
</script>

<style lang="scss" scoped>
.titleText {
  margin-bottom: 10px;
  color: rgb(95, 124, 206);
}
.el-form-item--mini {
  width: 90%;
}
::v-deep.el-form-item--mini .el-form-item__label {
  font-size: 12px !important;
}
.upload-demo {
  display: inline-block;
}
.unitClass {
  font-size: 12px !important;
  margin-left: 5px;
}

::v-deep .el-select-dropdown {
  position: absolute !important;
  top: 80% !important;
  left: 0px !important;
}
</style>
